// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_INV_WH_LOCATION
// * CreateDate    : 2013-12-20 23:31:45
// * Creater       : CodeSmith
// * LastChangeDate: 2013-12-20 23:31:45
// * LastChanger   : 2013-12-20 23:31:45
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Suzsoft.Smart.Data;
using ESOL.Common.Entity;

namespace ESOL.Business.Inv
{
/// <summary>
    /// InvWhLocation
    /// </summary>
    public partial class InvWhLocationBs
    {
        #region GetByID
        /// <summary>
        /// Get Entity
        /// </summary>
        /// <param name="objInvWhLocationEntity">Entity</param>
        /// <returns>Entity</returns>
        public static InvWhLocationEntity GetInvWhLocation(InvWhLocationEntity objInvWhLocationEntity)
        {
            return DataAccess.SelectSingle<InvWhLocationEntity>(objInvWhLocationEntity);
        }
        #endregion


        #region Insert
        /// <summary>
        /// Insert Data
        /// </summary>
        /// <param name="objInvWhLocationEntity">Entity</param>
        /// <returns>true Insert Succeed; false Insert Fail</returns>
        public static bool InsertInvWhLocation(InvWhLocationEntity objInvWhLocationEntity)
        {
            return DataAccess.Insert(objInvWhLocationEntity);
        }

        public static bool InsertInvWhLocation(List<InvWhLocationEntity> objInvWhLocationEntityList)
        {
            return DataAccess.Insert(objInvWhLocationEntityList);
        }
        #endregion


        #region Update
        /// <summary>
        /// Update Data
        /// </summary>
        /// <param name="objInvWhLocationEntity">Entity</param>
        /// <returns>true Update Succeed; false Update Fail</returns>
        public static bool UpdateInvWhLocation(InvWhLocationEntity objInvWhLocationEntity)
        {
            return DataAccess.Update(objInvWhLocationEntity);
        }

        public static bool UpdateInvWhLocation(List<InvWhLocationEntity> objInvWhLocationEntityList)
        {
            return DataAccess.Update<InvWhLocationEntity>(objInvWhLocationEntityList);
        }
        #endregion


        #region Delete
        /// <summary>
        /// Delete Data
        /// </summary>
        /// <param name="objInvWhLocationEntity">Entity</param>
        /// <returns>true Delete Succeed; false Delete Fail</returns>
        public static bool DeleteInvWhLocation(InvWhLocationEntity objInvWhLocationEntity)
        {
            return DataAccess.Delete(objInvWhLocationEntity);
        }

        public static bool DeleteInvWhLocation(List<InvWhLocationEntity> objInvWhLocationEntityList)
        {
            return DataAccess.Delete<InvWhLocationEntity>(objInvWhLocationEntityList);
        }
        #endregion


        #region GetAll
        /// <summary>
        /// Get All Data
        /// </summary>
        /// <returns>Back All Data<returns>
        public static DataSet GetInvWhLocationAll()
        {
            return DataAccess.SelectAllDataSet<InvWhLocationEntity>();
        }
        /// <summary>
        /// Get All Data List
        /// </summary>
        /// <returns>Back All Data List<returns>
        public static List<InvWhLocationEntity> GetInvWhLocationAllList()
        {
            return DataAccess.SelectAll<InvWhLocationEntity>();
        }
        #endregion

        public static List<InvWhLocationEntity> GetInvWhLocationAllList(InvWhLocationEntity loc)
        {
            return DataAccess.Select<InvWhLocationEntity>(loc);
        }

        public static List<InvWhLocationEntity> GetWhLocsByWhId(string whId)
        {
            var locs = DataAccess.Select<InvWhLocationEntity>(new InvWhLocationEntity { WhId = whId }).ToList();
            if (locs == null)
                return null;
            return locs;

        }

        public static DataSet GetWhLocsBySql(string sql)
        {
            return DataAccess.SelectDataSet(sql);
        }

        public static DataSet GetInvLocsDsByCodition(string condition)
        {
            string sql = "Select * from dbo.INV_WH_LOCATION WHERE IS_ACTIVE=1";
            return DataAccess.SelectDataSet(sql);
        }

	}
	
	
}	

